package test01;

import java.lang.reflect.Array;

/**
 * 泛型数组 - setter + 反射
 * @Author lzp
 * @Date 2024-04-01
 */
public class GeneriTest02<T> {

    private T[] arr;

    public T[] getArr() {
        return arr;
    }

    public void setArr(T[] arr) {
        this.arr = arr;
    }

    public GeneriTest02(Class<T> clazz, int length){
        arr = (T[]) Array.newInstance(clazz, length);
    }


}
